package dao;

import entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface UserDao {
    @Select("select * from t_user where id=#{id}")
    public User selectById(Integer id);

    public User selectById2(Integer id);

    public User selectById3(Integer id);

    public User selectById4(Integer id);

    public List<User> selectByRegistDate(Date registDate);

    public List<User> selectByHob(String hob);

    public List<User> selectByHobbies(String[] hobbies);

    public User selectByUsernameAndPassword(User user);

    public User selectByUsernameAndPassword2(Map<String,Object> map);

    public User selectByUsernameAndPassword3(String username,String password);

    public User selectByUsernameAndPassword4(String username,String password);

    public User selectByUsernameAndPassword5(@Param("username") String username, @Param("password") String password);

    public List<User> selectAll(String orderColumnName);

    public List<User> selectByPhone(String phone);

    public List<User> selectByLikePhone(String phone);

    public List<User> selectByLikePhone2(String phone);

    public List<Map<String,Object>> selectByPhone2(String phone);

    // @MapKey("id")
    // public Map<Integer,User> selectAllToMap();

    @MapKey("id")
    public Map<Integer,Map<String,Object>> selectAllToMap();

    public void insert(User user);

    public void update(User user);

    public void deleteById(Integer id);






    public List<User> selectByCriteria(User user);



    public List<User> selectByUsernames(List<String> usernames);





















}


























